#ifndef __SINGLETONE_H__
#define __SINGLETONE_H__

template<typename T>
class Singleton {
	private:
		Singleton(const Singleton<T> &);
		Singleton& operator=(const Singleton<T> &);

	protected:
		static T* m_singleton;

	public:
		Singleton(void) {
			m_singleton = static_cast<T*>(this);
		}

		~Singleton() {
			m_singleton = 0;
		}

		static T& getSingleton(void) {
			return *m_singleton;
		}

		static T* getSingletonPtr(void) {
			return m_singleton;
		}
};

#endif//__SINGLETONE_H__
